package com.example.module_notice.ui

import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.TextView
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.lib_common.base.BaseActivity
import com.example.lib_common.base.state.Empty
import com.example.lib_common.base.state.Failed
import com.example.lib_common.base.state.Loading
import com.example.lib_common.base.state.Success
import com.example.lib_common.observeWithLifecycle
import com.example.module_notice.R
import com.example.module_notice.databinding.ActivityNoticeDetailBinding
import com.example.module_notice.ui.notice.NoticeViewModel
import dagger.hilt.android.AndroidEntryPoint

@Route(path="/notice/detail")
@AndroidEntryPoint
class NoticeDetailActivity : BaseActivity<NoticeViewModel,ActivityNoticeDetailBinding>() {
    override val mLayoutResId: Int get() = R.layout.activity_notice_detail
    private val mViewModel : NoticeViewModel by viewModels()

    override fun initView() {
        super.initView()
        val noticeId = intent.getStringExtra("notice_id")
        mViewModel.getNoticeNotice(noticeId?.toInt()!!)
        mViewModel.mNoticeDetail.observe(this){
            mBinding.post = it
        }
    }
}